import socket
import time


def client(count):
    # 1
    s = socket.socket();
    port = 12345;
    host = socket.gethostname();
    # 2
    s.connect((host, port))
    print(s.recv(1024).decode())
    data1 = "client data ==" + str(count);
    # 3
    s.send(data1.encode())
    # 4
    s.close()


for i in range(10):
    time.sleep(1)
    client(i)
